//
//  HCAdoptTableViewCell.m
//  HappyChildren
//
//  Created by WillyZhao on 2017/1/18.
//  Copyright © 2017年 WillyZhao. All rights reserved.
//

#import "HCAdoptTableViewCell.h"

#import "HCMineAskedModel.h"


@interface HCAdoptTableViewCell () {
    HCMineAskedDataAnswer *answerData;
}

@end

@implementation HCAdoptTableViewCell

- (void)awakeFromNib {
    
    [super awakeFromNib];
    self.lineView.backgroundColor = YBKRGBCOLOR(242, 242, 242, 1);
    self.btnWidthContain.constant = 14;
    self.btnHeightContain.constant = 34;
    // Initialization code
}

-(void)setModel:(id)model {
    answerData = (HCMineAskedDataAnswer *)model;
    
    if ([answerData.ans_stat integerValue] == 0) {
        [self.sureBtn setBackgroundImage:[UIImage imageNamed:@"happy_asks_adopt"] forState:UIControlStateNormal];
        self.sureBtn.userInteractionEnabled = YES;
    }else{
        [self.sureBtn setBackgroundImage:[UIImage imageNamed:@"已采纳"] forState:UIControlStateNormal];
        self.sureBtn.userInteractionEnabled = NO;
    }
    
    //赋值
    [self.headIMG sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",answerData.ans_path]]];
    
    self.name.text = [NSString stringWithFormat:@"%@",answerData.ans_name];
    self.time.text = [NSString stringWithFormat:@"%@",answerData.ans_time];
    self.content.text = [NSString stringWithFormat:@"%@",answerData.ans_text];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
